Skip to content
This repository was archived by the owner on Dec 12, 2025. It is now read-only.

Conversation

@MarkBedrock
Copy link
Contributor

This PR implements the Bedrock side of Sprint 4.5, completing the migration to the new envelope-based Palantir transport protocol and hardening the IPC path shared with Phoenix.

Key Improvements

  1. Envelope-Based Transport
    • Replaced legacy [length][type][payload] framing with:
    [4-byte length][serialized MessageEnvelope]
    • Added envelope helpers:
    • extractMessage()
    • makeEnvelope()
    • parseEnvelope()
    • Removed all legacy framing logic.

  2. Deadlock Elimination & Transport Safety
    • Major refactor of parseIncomingData():
    • Lock scope narrowed to buffer-only operations
    • Dispatch occurs outside mutex
    • Removed locking from sendMessage()
    • Eliminated two critical deadlocks in the PalantirServer read/write path.

  3. Integration Test Harness
    • Added complete in-process integration harness:
    • IntegrationTestServerFixture
    • IntegrationTestClient
    • Added end-to-end integration tests:
    • Capabilities RPC — PASS
    • XY Sine RPC — PASS

  4. Documentation & Versioning
    • Added IPC protocol spec
    • Added integration harness docs
    • Added XY Sine integration doc
    • Updated Bedrock CHANGELOG with Sprint 4.5 entry

Breaking Change

⚠️ The new envelope protocol is not backward-compatible with the old transport.
Phoenix must be upgraded alongside Bedrock.

Tests
• Envelope helper tests: PASS (except known ASAN false positive)
• Integration tests:
• Capabilities: PASS
• XY Sine: PASS
• No deadlocks or hangs after refactor.

UnderLord added 8 commits November 24, 2025 19:41
…e (Sprint 4.5)

- Add MessageType enum to wire protocol (4-byte length + 1-byte type + payload)
- Implement message size limits (10MB max)
- Add ErrorResponse handling with ErrorCode enum
- Add backward compatibility for old format (deprecation warning)
- Update sendMessage/readMessage to use new protocol
- Add clientBuffersMutex_ to protect clientBuffers_ access
- Ensure all client buffer access is thread-safe
- Protect job-related data structures with jobMutex_
- Fix potential race conditions in onClientDisconnected
- Validate client pointers before use in sendMessage
- Clear all data structures in stopServer()
@MarkBedrock MarkBedrock merged commit c559290 into main Nov 25, 2025
6 checks passed
@MarkBedrock MarkBedrock deleted the sprint/4.5 branch November 25, 2025 21:43
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants